﻿@model EQueue.AdminWeb.Models.ClusterBrokerListViewModel
@{
    ViewBag.Title = "BrokerList";
}
<div>
    @using (Html.BeginForm("BrokerList", "Home", new { clusterName = ViewBag.ClusterName, brokerName = ViewBag.BrokerName }, FormMethod.Post, null, new { @class = "form-inline", role = "form" }))
    {
        <div class="form-group">
            <label class="sr-only" for="ClusterName"></label>
            @Html.TextBoxFor(m => m.ClusterName, new { @class = "form-control", placeholder = "ClusterName" })
        </div>
        <button type="submit" class="btn btn-default">查询</button>
    }
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="13%" class="vertical-center">
                    GroupName
                </th>
                <th width="13%" class="vertical-center">
                    BrokerName
                </th>
                <th width="8%" class="vertical-center">
                    BrokerRole
                </th>
                <th width="12%" class="vertical-center">
                    ProducerAddress
                </th>
                <th width="12%" class="vertical-center">
                    ConsumerAddress
                </th>
                <th width="12%" class="vertical-center">
                    AdminAddress
                </th>
                <th width="7%" class="vertical-center">
                    发送TPS
                </th>
                <th width="7%" class="vertical-center">
                    消费TPS
                </th>
                <th width="10%" class="vertical-center">
                    总堆积数
                </th>
                <th width="8%" class="vertical-center">
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.BrokerList)
            {
                var broker = item.BrokerInfo;
                <tr>
                    <td class="vertical-center">
                        @broker.GroupName
                    </td>
                    <td class="vertical-center">
                        @broker.BrokerName
                    </td>
                    <td class="vertical-center">
                        @broker.BrokerRole
                    </td>
                    <td class="vertical-center">
                        @broker.ProducerAddress
                    </td>
                    <td class="vertical-center">
                        @broker.ConsumerAddress
                    </td>
                    <td class="vertical-center">
                        @broker.AdminAddress
                    </td>
                    <td class="vertical-center">
                        @item.TotalSendThroughput
                    </td>
                    <td class="vertical-center">
                        @item.TotalConsumeThroughput
                    </td>
                    <td class="vertical-center">
                        @item.TotalUnConsumedMessageCount
                    </td>
                    <td class="vertical-center">
                        @Html.ActionLink("查看", "Index", "Broker", new { clusterName = broker.ClusterName, brokerName = broker.BrokerName }, null)
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

